<template>
	<view class="wrap">
		<view v-if="model.appsid">
			<js-error mode="bottom" ref="jsError"></js-error>
			<u-sticky class="u-sticky">
				<view class="cu-bar search" style="padding: 10px">
					<u-search style="flex: 1;" v-model="barCode" ref="uSearch" :focus="focus" placeholder="请先聚焦后扫描"
						:show-action="false" @search="confirm"></u-search>
					<view style="margin-left: 10px; display: flex; flex-direction: column">
						<u-icon @click="search" name="scan" size="50"></u-icon>
					</view>
				</view>
			</u-sticky>
			
			
			<view class="cu-form-group">
				<view class="title">单据号：</view>
				<view style="flex: 1;"> {{ model.matApp.ccode|| ""  }} （{{ model.matApp.ddate|| ""  }}）</view>
			</view>
			<view class="cu-form-group" style="position: relative;">
				<view class="title">存货编码：</view>
				<view style="flex: 1;"> {{ model.basInv.invCode|| ""  }}</view>
				<view v-if="invFlag" @click="handleFocus"
					style="text-align: center;position: fixed;top: 80rpx;left: 20rpx;margin: 0 20rpx;">
					<u-icon name="checkmark-circle" color="#81b337" size="60"></u-icon>
					<view style="color: #81b337"> 验证通过 </view>
				</view>
				<view v-if="!invFlag" @click="handleFocus"
					style="text-align: center;position: fixed;top: 80rpx;left: 20rpx;margin: 0 20rpx;">
					<u-icon name="info-circle" color="#ff9900" size="60"></u-icon>
					<view style="color: #ff9900"> 暂未验证 </view>
				</view>
			</view>
			<view class="cu-form-group">
				<view class="title">名称规格：</view>
				<view style="flex: 1;"> {{ model.basInv.invName|| ""  }} <text
						v-if="model.basInv.invStd">（{{ model.basInv.invStd}}）</text> </view>
			</view>
			<view class="cu-form-group">
				<view class="title">剩余/总数：</view>
				<view style="flex: 1;"> {{ model.matApps.syOutQty|| ""  }}/{{ model.matApps.iqty|| ""  }}
					（{{ model.basInv.unitName || "" }}）</view>
			</view>
			<view class="action bg-white "
				style="font-size: 20px;align-items: center;display: flex;padding: 0 10px 10px 10px;">
				<u-icon name="/static/image/detail.png" size="80"></u-icon>
				<text class="cuIcon-titles text-bold">数量信息</text>
				<!-- v-if="model.basWare.bwhpos == '1' || model.basInv.binvbatch == '1'" -->
				<view style="flex: 1;text-align: right;"
					v-if="model.basWare.bwhpos == '1' || model.basInv.binvbatch == '1'">
					<u-icon @click="GoaddChild()" name="plus-circle" size="90" color="#3E97B0"></u-icon>
				</view>
			</view>
			<view class="cu-form-group">
				<view class="title"><text class="cuIcon-favorfill text-xs text-red"></text>仓库：</view>
				<view style="flex: 1;"> {{ model.basWare.cwhname|| ""  }} </view>
			</view>
			<view style="padding: 10px;">

				<view v-for="(item,index) in children" class="cu-item shadow " style="position: relative;" :key="index"
					v-if="item.status != '1'">
					<view v-if="model.basWare.bwhpos == '1' || model.basInv.binvbatch == '1'" class="cu-form-group"
						style="display: flex;justify-content: space-between;">
						<view
							style=" display: inline-block;padding: 5px;background: #3E97B0;color: #fff;min-width: 40px;text-align: center;font-style: italic;font-weight: bold">
							{{ index + 1 }}
						</view>
						<view class="">
							<text v-if="model.basWare.bwhpos == '1' || model.basInv.binvbatch == '1'"
								style="font-size: 35px;" class="cuIcon-deletefill text-sl text-red"
								@tap="delDetail(item,index)"></text>
						</view>
					</view>
					<view class="cu-form-group " v-if="model.basInv.bfixExch != '0'">
						<view class="title"><text class="cuIcon-favorfill text-xs text-red"></text>件数：</view>
						<view style="flex: 1;">
							<u-input placeholder="请输入" @blur="inumChange($event,item,index)" v-model="item.inum" type="digit" di maxlength="200"></u-input>
						</view>
					</view>
					<view class="cu-form-group ">
						<view class="title"><text class="cuIcon-favorfill text-xs text-red"></text>数量：</view>
						<view style="flex: 1;">
							<u-input placeholder="请输入" @blur="iqtyChange($event,item,index)" v-model="item.iqty" type="digit" di maxlength="200" @input="cleariqtyChange($event,item,index)"></u-input>
							
						</view>
					</view>
					<view class="cu-form-group" v-if="model.basInv.bfixExch != '0'">
						<view class="title" style="padding-left: 30rpx;">换算率：</view>
						<view style="flex: 1;">
							{{ model.ichangeRate || '' }}
						</view>
					</view>
					<view class="cu-form-group " v-if="model.basWare.bwhpos == '1'">
						<view class="title"><text class="cuIcon-favorfill text-xs text-red"></text>货位：</view>
						<view style="flex: 1;">
							<u-input placeholder="请输入" v-model="item.posName" :disabled="true" type="text" di
								maxlength="200"></u-input>
						</view>
					</view>
					<view class="cu-form-group " v-if="model.basInv.binvbatch == '1'">
						<view class="title"><text class="cuIcon-favorfill text-xs text-red"></text>批次：</view>
						<view style="flex: 1;" v-if="model.basWare.bwhpos == '1'">
							<!-- <u-input placeholder="请输入" @input="cbatchChange($event,item,index)" v-model="item.cbatch"
								type="text" di maxlength="200"></u-input> -->
							<u-input placeholder="请选择" v-model="item.cbatch" type="select" @click="xzPos(index,item)"></u-input>
						</view>
						<view style="flex: 1;" v-else>
							<!-- <u-input placeholder="请输入" @input="cbatchChange($event,item,index)" v-model="item.cbatch"
								type="text" di maxlength="200"></u-input> -->
							<u-input placeholder="请选择" v-model="item.cbatch" type="select" @click="xzCbatch(index)" ></u-input>
						</view>
					</view>
					<view class="cu-form-group ">
						<view class="title" style="padding-left: 30rpx;">备注：</view>
						<view style="flex: 1;">
							<u-input placeholder="请输入" v-model="item.remarks" type="text" di maxlength="200"></u-input>
						</view>
					</view>
				</view>
			</view>
			<view style="height: 60px;"></view>
			<view class="btn-group cu-bar foot">
				<button class="cu-btn bg-green shadow-blur" @tap="submit()">
					<text class="cuIcon-command" style="margin-right: 10rpx;"></text> 确认出库
				</button>
			</view>
			<movable-area class="movable-area1">
				<movable-view class="movable-view" :x="x" :y="y" direction="all">
					
					
					<view @click="search" class="custom-style" style="width: 90px; height: 70px; color: #fff; border-radius: 10rpx;">
						
						<view style="font-size: 16px;display: flex; flex-direction: column;text-align: center;">
							<!-- <text class="cuIcon-scan text-xxl" ></text> -->
							<!-- <u-icon style="margin: auto;" name="/static/jeesite/sm1.png" size="80"></u-icon> -->
							<text class="cuIcon-camera text-xxls text-blue"></text>
							<view class="text-blue">条码识别</view>
						</view>
					</view>
					<!-- <button size="mini" >
						
					</button> -->
				</movable-view>
			</movable-area>
			
			
		</view>
	</view>
</template>

<script>
	import config from '@/common/config.js'
	import util from '@/common/fire.js'
	export default {
		data() {
			return {
				model: {
					// bwhPos: 1 ,  // 1 代表启用货位，0代表未启用货位
					// isConversion : 1,  // 1代表启用有换算率  ； 0 代表没有换算率
					// conversionType : 2,// 1代表固定换算率，2代表浮动换算率	
				},
				invFlag: false,
				focus: false,
				barCode: "",
				carType: '',
				carVenSelectList: [],
				cstatus: '',
				children: [],
				id: '1000004017',
				isSubmitting: false,
				x: 650, //x坐标
				y: 650, //y坐标
			}
		},
		onLoad(params) {
			this.getForm(params.id)

			uni.$on('cbatchObj', (data,index) => {
				console.log(index,'index',data)
				// this.model.invCode2 = data.invCode
				let arr = [...this.children]
				let flag = true
				arr.forEach(item =>{
					if (item.cbatch == data.cbatch) {
						flag = false
						this.$refs.jsError.showError('', '批次不能相同！', 'error');
					}
				})
				if (flag) {
					if (!this.children[index]) {
						this.$set(this.children, index, {}); // 使用 Vue.set 来确保响应性
					}
					this.children[index]['cbatch'] = data.cbatch;
					this.children[index]['iquantity'] = data.iqty;
				}
				this.$forceUpdate()
			})
			uni.$on('hwObjs', (data,index) => {
				console.log(data,'data===',index)
				if(index === ''){
					let arr = [...this.children]
					data.forEach(item => {
						let o = {
							posCode: item.cposCode,
							posName: item.cposName,
							cbatch:item.cbatch,
							iquantity:item.iquantity
						}
						let flag = true
						arr.forEach(q => {
							if (item.cposCode == q.posCode && item.cbatch == q.cbatch) {
								flag = false
							}
						})
						if (flag) {
							this.children.unshift(o)
						}	
						
						// if (this.model.basInv.binvbatch != '1') {
						// 	if (flag) {
						// 		this.children.push(o)
						// 	}
						// } else {
						// 	this.children.push(o)
						// }
					
					})
				}else{
					let arr = [...this.children]
					const flag = arr.every(item => item.cbatch != data[0]['cbatch']&& item.cposCode != data[0]['cposCode']);
					if (flag) {
						this.children[index]['cbatch'] = data[0]['cbatch'];
						this.children[index]['iquantity'] = data[0]['iquantity'];
						this.$forceUpdate()
					}else{
						this.$refs.jsError.showError('', '已存在相同货位相同批次！', 'error');
					}
					
				}
				this.$forceUpdate()
			})
		},
		onShow() {
		},
		methods: {
			xzCbatch(index){
				console.log(index,'index')
				// '/pages/mf/llsq/invForm?items=' + JSON.stringify(items) + '&icon=' + code 
				let data = {
					invCode:this.model.basInv.invCode,
					whCode:this.model.basWare.cwhcode
				}
				data.invCode ? data.bmustInv = 1 : ''
				data.whCode ? data.bmustWh = 1 : ''
				uni.navigateTo({
					url: '/pages/mf/llsq/cbatchXz?index='+index + '&data=' + JSON.stringify(data),
					events: {
						// 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
						Filter(data) {
							console.log(data)
						}
					},
					success: function(res) {
						// 通过eventChannel向被打开页面传送数据
						//res.eventChannel.emit('initfilter', that.queryData)
					}
				})
			},
			makeSound(name){
				console.log("=====testClick=====");
				let src = '/static/'+name+'.mp3';
				//实例化声音  
				const Audio = uni.createInnerAudioContext();
				Audio.autoplay = true;
				Audio.src = src; //音频地址  
				Audio.play(); //执行播放  
				Audio.onError((res) => {
				});
				Audio.onPause(function() {
					console.log('end');
					Audio.destroy();
				});
			},
			cbatchChange(e, item, index) {
				item.cbatch = e
				if (this.model.basWare.bwhpos != '1') {
					let newArr = this.children.map(item => item.cbatch)
					let arrSet = new Set(newArr)
					if (arrSet.size != newArr.length && this.model.basInv.binvbatch == '1') {
						this.$nextTick(() => {
							item.cbatch = ''
						})
						this.$forceUpdate()
						this.$refs.jsError.showError('', '批次不能相同！', 'error');
						return;
					}
				}

				if (this.model.basWare.bwhpos == '1') {
					let f = this.hasDuplicateIdAndName(this.children)
					if (f) {
						this.$nextTick(() => {
							item.cbatch = ''
						})
						this.$forceUpdate()
						this.$refs.jsError.showError('', '相同货位，批次不能相同！', 'error');
						return;
					}

				}

			},
			cleariqtyChange(e, item, index){
				if(!e){
					item.iqty = null
					this.model.ichangeRate = null
					this.$forceUpdate()
				}
			},
			iqtyChange(e, item, index) {
				// e = e.match(/^\d*(\.?\d{0,4})/g)[0]
				if(!e){
					item.iqty = null
					this.model.ichangeRate = null
					this.$forceUpdate()
					return;
				}
				// item.iqty = Number(e).toFixed(config.scaleNum)
				item.iqty = util.toNumberFixed(Number(e))
				if (this.model.basInv.bfixExch == '1') {
					// item.inum = (e / this.model.ichangeRate).toFixed(config.scaleNum)
					item.inum = util.toNumberFixed(e / this.model.ichangeRate)
				}
				if (this.model.basInv.bfixExch == '2') {
					if(item.inum){
						// this.model.ichangeRate = ( item.iqty / item.inum).toFixed(config.scaleChangeRate)
						this.model.ichangeRate = util.toNumberFixed(item.iqty / item.inum)
					}else{
						this.model.ichangeRate = null
					}
				}
				this.$forceUpdate()
			},
			inumChange(e, item, index) {
				// e = e.match(/^\d*(\.?\d{0,4})/g)[0]
				item.inum = util.toNumberFixed(Number(e))
				if(this.model.basInv.bfixExch != '0'){
					if(!!this.model.ichangeRate){
						// item.iqty = (e * this.model.ichangeRate).toFixed(config.scaleQty)
						item.iqty = util.toNumberFixed(e * this.model.ichangeRate)
					}
				}else{
					item.inum = null
				}
				this.$forceUpdate()
			},
			getForm(appsid) {
				this.$u.api.mf.wmsRd11Form({
					appsid
				}).then(res => {
					this.model = res.wmsRd11
					// this.model.basWare.bwhpos = '0'
					// this.model.basWare.cwhcode = '105'
					// this.model.basInv.bfixExch = 1
					if (this.model.basWare.bwhpos == '0' && this.model.basInv.binvbatch == '0') {
						this.children.unshift({})
					}
				})
			},
			confirm() {
				this.focus = false
				console.log(this.barCode, 'barCode')
				this.commonSearch(this.barCode)
			},
			search() {
				var _that = this;
				_that.focus = false
				if(this.vuex_config.deviceType === this.vuex_config.deviceTypeAPP){
					const wechat = uni.getSystemInfoSync()?.host?.env
					if (wechat === 'WeChat') {
					    uni.scanCode({
					    	scanType: ["barCode", "qrCode"],
					    	// onlyFromCamera: true,
					    	success: async (res) => {
					    		_that.barCode = res.result;
					    		await _that.commonSearch(res.result)
					    	},
					    });
					} else {
						var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
						console.log('mpaasScanModule',mpaasScanModule)
						
						mpaasScanModule.mpaasScan({
							// 扫码识别类型，参数可多选，qrCode、barCode，不设置，默认识别所有
							'scanType':  ['qrCode','barCode'],
							// 是否隐藏相册，默认false不隐藏
							'hideAlbum': false,
							//ios需要设置这个参数，只支持中英文 zh-Hans、en，默认中文                       
							'language' : 'en',
							//相册选择照片识别错误提示(ios)
							'failedMsg': '未识别到二维码，请重试',
							//Android支持全屏需要设置此参数
							'screenType': 'full'              
						},
						async (ret) => {
							console.log('ret',ret)
							if(ret.resp_message == 'success'){
								_that.barCode = ret.resp_result;
								await _that.commonSearch(ret.resp_result)
							}
						})
					}
				}else if(this.vuex_config.deviceType === this.vuex_config.deviceTypePDA){
					_that.handleFocus()
				}
				
			},
			async commonSearch(barCode) {
				let that = this
				//扫货位
				if (util.checkBarcode(barCode, this.vuex_config.PositionPrefix) && that.model.basWare.bwhpos == '1') {
					this.$u.api.mf.getBarInfo({
						barCode,
						whCode: this.model.whCode
					}).then(res => {
						if (res.result == 'true') {
							if (!res.error) {

								if (that.model.basInv.binvbatch == '1') {
									that.children.unshift({
										posCode: res.data.code,
										posName: res.data.name,
									})
									setTimeout(()=>{
										that.makeSound("cg");
									},500)
									that.$u.toast('成功！');
								} else {
									let flag = true
									that.children.forEach(item => {
										if (item.posCode == res.data.code) {
											flag = false
										}
									})
									if (flag) {
										that.children.unshift({
											posCode: res.data.code,
											posName: res.data.name,
										})
										setTimeout(()=>{
											that.makeSound("cg");
										},500)
										that.$u.toast('成功！');
									} else {
										setTimeout(()=>{
											that.makeSound("sb");
										},500)
										that.$refs.jsError.showError('', '已存在相同货位！', 'error');
									}

								}

							} else {
								setTimeout(()=>{
									that.makeSound("sb");
								},500)
								that.$refs.jsError.showError('', res.error, 'error');
							}
						} else {
							setTimeout(()=>{
								that.makeSound("sb");
							},500)
							that.$refs.jsError.showError('', res.message, 'error');
						}


					})
				} else if (util.checkBarcode(barCode, this.vuex_config.InventoryPrefix)) {
					this.$u.api.mf.getBarInfo({
						barCode,
					}).then(res => {
						if(res.result == 'true'){
							if (!res.error) {
								if(res.data.basInv && res.data.basInv.invCode == that.model.invCode){
									that.invFlag = true
									setTimeout(()=>{
										that.makeSound("cg");
									},500)
									that.$u.toast('验证成功！');
								}else{
									setTimeout(()=>{
										that.makeSound("sb");
									},500)
									that.$refs.jsError.showError('', '验证失败！', 'error');
								}
								
							} else {
								setTimeout(()=>{
									that.makeSound("sb");
								},500)
								that.$refs.jsError.showError('', res.error, 'error');
							}
						}else{
							setTimeout(()=>{
								that.makeSound("sb");
							},500)
							that.$refs.jsError.showError('', res.message, 'error');
						}
					})
				} else {
					setTimeout(()=>{
						that.makeSound("sb");
					},500)
					this.$refs.jsError.showError('', '请扫描正确的条码！', 'error');
				}
				if(this.vuex_config.deviceType === this.vuex_config.deviceTypePDA){
					this.handleFocus()
				}
				setTimeout(() => {
					this.barCode = '';
				}, 500);

			},
			handleFocus() {
				var _that = this;
				_that.focus = false;
				setTimeout(() => {
					_that.focus = true;
				}, 500)
			},
			delDetail(item, index) {
				let that = this
				uni.showModal({
					title: '删除提示',
					content: '是否删除此货位信息？',
					confirmColor: '#F54E40',
					success: (res) => {
						if (!res.confirm) {
							return false;
						}

						that.children.splice(index, 1);
						that.$forceUpdate()
					}
				})
			},
			hwxz() {
				const that = this
				let data = {
					cinvCode:this.model.basInv.invCode,
					whCode:this.model.basWare.cwhcode
				}
				data.cinvCode ? data.bmustInv = 1 : ''
				data.cwhCode ? data.bmustWh = 1 : ''
				uni.navigateTo({
					url: '/pages/mf/llsq/hwXz?data=' + JSON.stringify(data),
					events: {
						Filter(data) {

						}
					},
					success: function(res) {
						// 通过eventChannel向被打开页面传送数据
						//res.eventChannel.emit('initfilter', that.queryData)
					}
				})
			},
			GoaddChild() {
				if (this.model.basWare.bwhpos == '1') {
					let data = {
						cinvCode:this.model.basInv.invCode,
						cwhCode:this.model.basWare.cwhcode
					}
					data.cinvCode ? data.bmustInv = 1 : ''
					data.cwhCode ? data.bmustWh = 1 : ''
					uni.navigateTo({
						url: '/pages/mf/llsq/hwXz?data=' + JSON.stringify(data),
						events: {
							Filter(data) {

							}
						},
						success: function(res) {

						}
					})
				} else {
					this.children.unshift({})
				}
			},
			xzPos(index,item){
				if(!item.posName){
					this.$refs.jsError.showError('', '请先确定货位', 'error');
					return;
				}
				if(!!item.cbatch) return
				let data = {
					cinvCode:this.model.basInv.invCode,
					cwhCode:this.model.basWare.cwhcode,
					cposCode:item.posCode,
				}
				data.cinvCode ? data.bmustInv = 1 : ''
				data.cwhCode ? data.bmustWh = 1 : ''
				console.log(data,'data')
				uni.navigateTo({
					url: '/pages/mf/zc/hwXz?data=' + JSON.stringify(data)+'&index='+ index,
					events: {
						Filter(data) {
									
						}
					},
					success: function(res) {
						// 通过eventChannel向被打开页面传送数据
						//res.eventChannel.emit('initfilter', that.queryData)
					}
				})
				this.$forceUpdate()
			},
			hasDuplicateIdAndName(arr) {
				const seen = new Map();

				for (const item of arr) {
					const key = `${item.posCode}-${item.cbatch}`;

					if (seen.has(key)) {
						return true; // 发现重复的 id 和 name 组合
					}

					seen.set(key, true);
				}

				return false; // 没有发现重复的 id 和 name 组合
			},
			submit(data) {
				if(!this.invFlag){
					this.$refs.jsError.showError('','请先验证存货！','error');
					return;
				}

				if (!this.children.length) {
					this.$refs.jsError.showError('', '请先添加数量信息！', 'error');
					return;
				}
				let iqtySum = 0;
				let iquantitySum = 0;
				let iqtyFlag = true;
				let inumFlag = true;
				let posNameFlag = true;
				let cbatchFlag = true;
				let iquantityFlag = true;
				console.log(this.children,'this.children')
				this.children.forEach(item => {
					iqtySum += Number(item.iqty)
					

					if (!item.iqty || Number(item.iqty) <= 0) {
						iqtyFlag = false
					}
					if (!item.inum || item.inum == '0') {
						inumFlag = false
					}
					if (!item.posName) {
						posNameFlag = false
					}
					if (!item.cbatch) {
						cbatchFlag = false
					}
				})
				
				let hasError = false;
				let hasErrorMsg = ''
				this.children.some(item => {
					console.log('iquantity',item.iquantity,item.iqty)
				  if (item.iquantity && item.iquantity < item.iqty && ((this.model && this.model.basWare && this.model.basWare.bwhpos === '1') || this.model?.basInv?.binvbatch === '1')) {
				    hasErrorMsg = `批次${item.cbatch},货位${item.posName}出库数${item.iqty}不能大于存量总数${item.iquantity}`
				    hasError = true; // 设置错误标志
				    return true; // 中断 some 遍历
				  }
				  return false;
				});
				
				if (hasError) {
				  this.$refs.jsError.showError('', hasErrorMsg , 'error');
				  return false;
				}
				
				if (!iqtyFlag) {
					this.$refs.jsError.showError('', '请填入数量！', 'error');
					return;
				}
				if (!inumFlag && this.model.basInv.bfixExch != '0') {
					this.$refs.jsError.showError('', '请填入件数！', 'error');
					return;
				}
				if (!posNameFlag && this.model.basWare.bwhpos == '1') {
					this.$refs.jsError.showError('', '请选择货位！', 'error');
					return;
				}
				if (!cbatchFlag && this.model.basInv.binvbatch == '1') {
					this.$refs.jsError.showError('', '请填入批次！', 'error');
					return;
				}
				// iqtySum = iqtySum.toFixed(config.scaleQty)
				iqtySum =util.toNumberFixed(iqtySum)
				if (iqtySum > this.model.matApps.syOutQty) {
					this.$refs.jsError.showError('', `本次出库总数${iqtySum}不能大于${this.model.matApps.syOutQty}`, 'error');
					return;
				}

				if (this.model.basWare.bwhpos != '1') {
					let newArr = this.children.map(item => item.cbatch)
					let arrSet = new Set(newArr)
					if (arrSet.size != newArr.length && this.model.basInv.binvbatch == '1') {
						this.$refs.jsError.showError('', '批次不能相同！', 'error');
						return;
					}
				}


				if (this.model.basWare.bwhpos == '1' && this.model.basInv.binvbatch == '1') {
					let f = this.hasDuplicateIdAndName(this.children)
					if (f) {
						this.$refs.jsError.showError('', '相同货位，批次不能相同！', 'error');
						return;
					}

				}
				if (this.isSubmitting) {
						return;
				} else {
					this.isSubmitting = true;
					var data = {
						...this.model,
						childList: this.children,
					
					};
					try {
					  this.$u.api.mf.wmsRd11Save(data).then(res => {
					  	if (res.result == 'true') {
					  		this.$u.toast(res.message);
					  		setTimeout(() => {
					  			uni.navigateBack({
					  				delta: 1
					  			})
					  		}, 500)
					  	} else {
					  		this.$refs.jsError.showError('', res.message, 'error');
					  	}
					  
					  });
					} catch (error) {
						this.$refs.jsError.showError('', error.message, 'error');
					} finally {
					  this.isSubmitting = false;
					} 
					
					
				}



				
				
			},
		}
	}
</script>
<style scoped lang="scss">
	/* .footer {
	position: fixed;
	left: 0;
	bottom: 20px;
	width: 100%;
	
} */
	$all_width: 96rpx;
	$all_height: 96rpx;
	.movable-area1 {
		z-index: 888;
		height: 97vh;
		width: 650rpx;
		position: fixed;
		right: $all_width;
		top: -($all_height + 100rpx);
		pointer-events: none; //此处要加，鼠标事件可以渗透
		.movable-view {
			width: $all_width;
			height: $all_height;
			pointer-events: auto; //恢复鼠标事件
			image {
				width: $all_width;
				height: $all_height;
			}
		}
	}
	.text-xxls{
		font-size:60rpx;
	}
	.hide {
		display: none;
	}

	.cu-bar {
		min-height: 60px;
	}


	.foot {
		background: #fff;
	}

	.cu-item {
		flex-wrap: wrap;
		padding: 8px 15px !important;
	}

	.title {
		width: 220rpx;
	}

	.cu-modal-slot {
		margin: 42rpx 32rpx 20rpx 32rpx;
		height: 100vh;
		position: relative;
	}

	.cu-modal-header {
		font-size: 38rpx;
		color: #3d3d3d;
		line-height: 40rpx;
		text-align: left;
		font-weight: 500;
	}

	.button {
		font-size: 32rpx;
		color: #666666;
		line-height: 40rpx;
		padding: 12rpx 40rpx;
		margin-bottom: 20rpx;
		background: #e2e2e2;
		border-radius: 180rpx;
	}

	.button:hover {
		background: #3e97b0;
		color: #ffffff;
	}

	.cu-modal-search-title {
		margin: 32rpx 0rpx 20rpx 0rpx;
		text-align: left;
		font-size: 32rpx;
		color: #999999;
		line-height: 40rpx;
	}

	.cu-dialog {
		background: #ffffff;
	}

	.cu-modal-footer {
		padding: 32rpx 32rpx;
		width: 100%;
	}

	.cu-btn {
		font-size: 16px;
		height: 40px;
		width: 50%;
	}

	.bg-confirm {
		background: #3e97b0;
		color: #ffffff;
	}
</style>